<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="bidgetserver.Product" %>
<%@ page import="bidgetserver.PMF" %>

<html>
  <body bgcolor="6699FF">

    <h2>Show Products (JSON):</h2>
    <form action="/showproducts" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="userName" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="show products" /></div>
    </form>

    <h2>Add Product:</h2>
    <form action="/addproduct" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="userName" rows="1" cols="20"></textarea></div>
      <div><b>content1 == product key:</b></div>
      <div><textarea name="content1" rows="1" cols="20"></textarea></div>
      <div><b>isBuy:</b></div>
      <div><textarea name="isbuy" rows="1" cols="20"></textarea></div>
      <div><b>Product Picture Link:</b></div>
      <div><textarea name="ProductPic" rows="1" cols="20"></textarea></div>
      <div><b>Product's Name:</b></div>
      <div><textarea name="ProductName" rows="1" cols="20"></textarea></div>
      <div><b>cell phone number:</b></div>
      <div><textarea name="cellNum" rows="1" cols="20"></textarea></div> 
      <div><input type="submit" value="add product" /></div>
    </form>

    <h2>Delete Product:</h2>
    <form action="/delete" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="userName" rows="1" cols="20"></textarea></div>
      <div><b>content 2:</b></div>
      <div><textarea name="content2" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="delete product" /></div>
    </form>

    <h2>Add Product to History:</h2>
    <form action="/addproduct" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="userName" rows="1" cols="20"></textarea></div>
      <div><b>content3:</b></div>
      <div><textarea name="content3" rows="1" cols="20"></textarea></div>
      <div><b>Product Picture Link:</b></div>
      <div><textarea name="ProductPic" rows="1" cols="20"></textarea></div>
      <div><b>Product's Name:</b></div>
      <div><textarea name="ProductName" rows="1" cols="20"></textarea></div>
      <div><b>cell phone number:</b></div>
      <div><textarea name="cellNum" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="add to history" /></div>
    </form>

    <h2>Delete Product from History:</h2>
    <form action="/delete" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="userName" rows="1" cols="20"></textarea></div>
      <div><b>content4:</b></div>
      <div><textarea name="content4" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="delete from history" /></div>
    </form>

    <h2>Update Price:</h2>
    <form action="/update" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="userName" rows="1" cols="20"></textarea></div>
      <div><b>time ID:</b></div>
      <div><textarea name="timeID" rows="1" cols="20"></textarea></div>
      <div><b>price ID:</b></div>
      <div><textarea name="ID" rows="1" cols="20"></textarea></div>
      <div><b>price:</b></div>
      <div><textarea name="price" rows="1" cols="20"></textarea></div>
      <div><b>Time to alert:</b></div>
      <div><textarea name="timeToAlert" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="update price" /></div>
    </form>

    <h2>Clear History:</h2>
    <form action="/clear" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="userName" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="clear history" /></div>
    </form>
    
        <h2>Clear all Products for given user:</h2> 
    <font size="3" color="FFFF33"><b>** only for server's admin. no client side relation.</b></font>
    <form action="/clearproducts" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="UserName" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="Clear user products" /></div>
    </form>
 
    <h2>Add Search Reminder:</h2>   
    <form action="/addreminder" method="post">
      <div><b>search string:</b></div>
      <div><textarea name="SearchString" rows="1" cols="20"></textarea></div>
      <div><b>top 5 results:</b></div>
      <div>insertion format example '1','2','3','4','5'</div>
      <div><textarea name="top5results" rows="1" cols="20"></textarea></div>
      <div><b>user name:</b></div>
      <div><textarea name="UserName" rows="1" cols="20"></textarea></div>
      <div><b>minimum price:</b></div>
      <div><textarea name="minPrice" rows="1" cols="20"></textarea></div>
      <div><b>maximum price:</b></div>
      <div><textarea name="maxPrice" rows="1" cols="20"></textarea></div>
      <div><b>ID (opt):</b></div>
      <div><textarea name="ID" rows="1" cols="20"></textarea></div> 
      <div><input type="submit" value="add search reminder" /></div>
    </form>

    <h2>Delete Search Reminder:</h2>     
    <form action="/deletereminder" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="UserName" rows="1" cols="20"></textarea></div>
      <div><b>search string:</b></div>
      <div><textarea name="SearchString" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="delete search reminder" /></div>
    </form>

     <h2>Send Reminders to Client (JSON):</h2>     
     <form action="/sendremindertoclient" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="UserName" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="send reminders to client" /></div>
    </form>

    <h2>Check For Reminder Update:</h2> 
    <font size="3" color="FFFF33"><b>** email notification is sent to client in case of search results update</b></font>
    <form action="/updatereminder" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="UserName" rows="1" cols="20"></textarea></div>
      <div><b>reminder ID:</b></div>
      <div><textarea name="reminderID" rows="1" cols="20"></textarea></div>
      <div><b>search string:</b></div>
      <div><textarea name="SearchString" rows="1" cols="20"></textarea></div> 
      <div><b>new reminder result picture:</b></div>
      <div><textarea name="reminderPic" rows="1" cols="20"></textarea></div> 
      <div><input type="submit" value="Check for reminder update" /></div>
    </form>
    
    <h2>Clear all search reminders for given user:</h2> 
    <font size="3" color="FFFF33"><b>** only for server's admin. no client side relation.</b></font>
    <form action="/clearreminders" method="post">
      <div><b>user name:</b></div>
      <div><textarea name="UserName" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="Clear user reminders" /></div>
    </form>
    
    <h2>SMS testing:</h2> 
    <font size="3" color="FFFF33"><b>** only for server's admin. no client side relation.</b></font>
    <form action="/smstest" method="post">
      <div><b>insert your cell phone number:</b></div>
      <div><textarea name="cellNum" rows="1" cols="20"></textarea></div>
      <div><input type="submit" value="send SMS" /></div>
    </form>

  </body>
</html>